/*
 * @Description:
 * @Author: Zzt
 * @Date: 2022-08-09 14:59:01
 * @LastEditTime: 2022-08-09 16:15:02
 */

import { useEffect } from 'react';
import { Menu } from 'antd';
import { useDestructionContext } from '../contexts/DestructionContext';

const StateSidebar = () => {
  const { setSidebar } = useDestructionContext();
  const items = [
    { label: '全部', key: 'all' },
    { label: '待我处理', key: 'wait' },
    { label: '已处理审核', key: 'audit' },
    { label: '已通过', key: 'success' },
    { label: '审核退回', key: 'failure' }
  ];
  useEffect(() => {
    setSidebar('all');
  }, []);
  const onClick = (event: any) => {
    console.log(event.key);
    setSidebar(event.key);
  };
  return (
    <>
      <h4>审核状态</h4>
      <Menu items={items} onClick={onClick} defaultSelectedKeys={['all']} />
    </>
  );
};

export default StateSidebar;
